package com.itheima.Demo8bufferedreader;

import javax.print.DocFlavor;
import java.io.*;
import java.util.stream.Stream;

public class BufferedReaderDemo1
{
    public static void main(String[] args) {
        demo1("D:\\a.txt","D:\\b.txt");
    }
    public static void demo1(String srcPath,String destPath)
    {
        try (  BufferedReader br = new BufferedReader(new FileReader(srcPath));
                BufferedWriter bw = new BufferedWriter(new FileWriter(destPath))) {
            char[]line = new char[1024];
            //readline的使用
            String line1;
            while((line1=br.readLine())!=null)
            {
                System.out.println(line1);
            }

        }catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}
